export function loadMap() {
    return new Promise((resolve, reject) => {
        if (window.AMap) { resolve(window.AMap) }
        else {
            const script = document.createElement('script')
            script.type = 'text/javascript'
            script.src = 'https://webapi.amap.com/maps?v=1.4.15&key=cde8b06348979eefb90c15d266a4a6ee'
            script.onerror = reject
            document.head.appendChild(script)
        }

        window.init = function () {
            resolve(window.AMap)
        }

    })
}